package org.example.controller;

import org.example.domain.Driver;
import org.example.result.Result;
import org.example.service.DriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/driver")
public class DriverController {
    @Autowired
    private DriverService driverService;

    /**
     * 查看物流
     * @return
     */
    @RequestMapping("/list")
    public Result list(){
        List<Driver> list = driverService.list();
        return Result.success(list);
    }

    /**
     * 到达目的地
     * @param id
     * @return
     */
    @RequestMapping("/updateStatus")
    public Result updateStatus(Integer id){
        driverService.updateStatus(id);
        return Result.success();
    }

    /**
     * 添加进时序数据库
     * @return
     */
    @RequestMapping("/addTdeng")
    public Result addTdeng(){
        return null;
    }
}
